'use strict';

// 用户相关请求响应定义
const adminUserReqAndResp = require('../entitys/reqAndResp/admin/adminUser');
// 用户角色相关请求响应定义
const adminRolesReqAndResp = require('../entitys/reqAndResp/admin/adminRoles');
// 菜单管理
const sysMenusReqAndResp = require('../entitys/reqAndResp/admin/sysMenus');
// wx授权管理
const wxUserAuthorization = require('../entitys/reqAndResp/admin/userAuthorization');
// 合同模板管理
const aisContractMouldReqAndResp = require('../entitys/reqAndResp/ais/contractMould');
// 合同模板信息
const aisContractReqAndResp = require('../entitys/reqAndResp/ais/contract');
// 设备管理
const sysdeviceReqAndResp = require('../entitys/reqAndResp/admin/device');
// 在哪小程序
const zainaXcxReqAndResp = require('../entitys/reqAndResp/wxin/znaXcx');
// wx客户管理
const wxpaUserReqAndResp = require('../entitys/reqAndResp/admin/WxpaUser');
// 布控管理
const zainaControlReqAndResp = require('../entitys/reqAndResp/admin/alarm');
// 案件管理
const aisContractCaseReqAndResp = require('../entitys/reqAndResp/ais/contractCase');
// 保险管理
const aisInsureReqAndResp = require('../entitys/reqAndResp/ais/insure');
// 就NB设备厂商、产品类型管理
const aisNbProductReqAndResp = require('../entitys/reqAndResp/ais/nbProduct');
// 就NB设备厂商、产品类型管理
const nbInsureCouponReqAndResp = require('../entitys/reqAndResp/ais/nbInsureCoupon');
// 回访相关功能
const visitRecordReqAndResp = require('../entitys/reqAndResp/ais/visitRecord');

// 操作文件类库
const fs = require('fs');

/**
 * 挂在 扩展方法到 request对象上
 */
module.exports = {
    // 获取带图片的请求参数
    async getMultipart() {
        const parts = this.ctx.multipart();
        const uploaderId = this.ctx.curAdminUser.id;
        let part = {};
        const modelInfo = {};
        while ((part = await parts()) != null) {
            if (part.length) {
                modelInfo[`${part[0]}`] = part[1];
                const regExp = /^data:[img,image]+\/\w+;base64,/;
                if (part[1].match(regExp)) {
                    const base64 = part[1].replace(regExp, ''); // 去掉图片base64码前面部分data:image/png;base64
                    const dataBuffer = new Buffer(base64, 'base64'); // 把base64码转成buffer对象
                    const imgPath = `${process.cwd()}/app/public/images/${uploaderId}_${part[0]}_${new Date().getTime()}.jpg`;
                    modelInfo[`${part[0]}`] = imgPath;
                    fs.writeFile(imgPath, dataBuffer, err => {
                        // 用fs写入文件
                        if (err) {
                            console.log(err);
                        } else {
                            console.log('写入成功！');
                        }
                    });
                }
            } else {
                if (!part.filename) continue;
                modelInfo[`${part.fieldname}`] = '';
                if (part.fieldname) {
                    const imgPath = `${process.cwd()}/app/public/images/${uploaderId}_${part.fieldname}_${new Date().getTime()}.jpg`;
                    modelInfo[`${part.fieldname}`] = imgPath;
                    const fileStream = fs.createWriteStream(imgPath);
                    await part.pipe(fileStream);
                }
            }
        }
        this.body = Object.assign(modelInfo, this.body);
    },
    async getFileStream() {
        const parts = this.ctx.multipart();
        let part = {};
        const respFileStreams = [];
        while ((part = await parts()) != null) {
            console.log('文件流：', part);
            if (!part.filename) continue;
            // console.log('文件流：', part);
            const file = {};
            part.pipe(file);
            respFileStreams.push(file);
        }
        return respFileStreams;
    },

    // 登录
    getAndValidate_LoginRequest() {
        let request = adminUserReqAndResp.login.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询用户列表
    getAndValidate_QueryAdminUsersList() {
        let request = adminUserReqAndResp.queryAdminUsersList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 用户详情
    getAndValidate_QueryAdminUser() {
        let request = adminUserReqAndResp.queryAdminUser.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 添加用户
    getAndValidate_AddUserRequest() {
        let request = adminUserReqAndResp.addAdminUser.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 删除用户
    getAndValidate_DeleteAdminUserRequest() {
        let request = adminUserReqAndResp.deleteAdminUser.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 更新用户
    getAndValidate_UpdateAdminUserRequest() {
        let request = adminUserReqAndResp.updateAdminUser.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询所有角色列表（分页）
    getAndValidate_QueryAdminRolesList() {
        let request = adminRolesReqAndResp.queryAdminRolesList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 添加角色
    getAndValidate_addAdminRoleRequest() {
        let request = adminRolesReqAndResp.addAdminRoles.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 修改角色
    getAndValidate_UpdateAdminRoleRequest() {
        let request = adminRolesReqAndResp.updateAdminRoles.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 删除角色(逻辑删除)
    getAndValidate_DeleteAdminRoleRequest() {
        let request = adminRolesReqAndResp.DeleteAdminRoles.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 设置角色权限
    getAndValidate_SetRoleAuthoRequest() {
        let request = adminRolesReqAndResp.SetRoleAutho.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 获取角色权限
    getAndValidate_GetRoleAuthoRequest() {
        let request = adminRolesReqAndResp.getRoleAutho.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 获取角色拥有的菜单列表（功能级别）
    getAndValidate_getRoleMenuUserRights() {
        let request = adminRolesReqAndResp.getRoleMenuUserRights.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 添加菜单
    getAndValidate_addSysMenus() {
        let request = sysMenusReqAndResp.addSysMenu.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 更新菜单
    getAndValidate_updateMenu() {
        let request = sysMenusReqAndResp.updateMenu.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询用户授权
    getAndValidate_queryUserAuthorization() {
        let request = wxUserAuthorization.userAuthorization.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 添加合同模板
    getAndValidate_AddContractMould() {
        let request = aisContractMouldReqAndResp.addContractMould.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询合同魔板列表
    getAndValidate_QueryContractMould() {
        let request = aisContractMouldReqAndResp.queryContractMould.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询合同模板保障利益
    getAndValidate_QueryContractMouldInsure() {
        let request = aisContractMouldReqAndResp.queryContractMouldInsure.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询合同模板详情
    getAndValidate_QueryContractMouldById() {
        let request = aisContractMouldReqAndResp.queryContractMouldById.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 编辑合同模板详情
    getAndValidate_EditContractMouldById() {
        let request = aisContractMouldReqAndResp.editContractMouldById.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 启用停用合同模板
    getAndValidate_EnableContractMould() {
        let request = aisContractMouldReqAndResp.enableContractMould.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询合同用户
    getAndValidate_queryWxPublicList() {
        let request = zainaControlReqAndResp.queryWxPublicList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询电话列表
    getAndValidate_queryPhoneList() {
        let request = zainaControlReqAndResp.queryPhoneList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 接通排行
    getAndValidate_queryCalledSuccess() {
        let request = zainaControlReqAndResp.queryCalledSuccess.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 添加合同信息
    getAndValidate_AddContract() {
        let request = aisContractReqAndResp.addContract.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询合同详情
    getAndValidate_QueryContractById() {
        let request = aisContractReqAndResp.queryContractById.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询合同详情 for 审核
    getAndValidate_QueryContractForExamine() {
        let request = aisContractReqAndResp.queryContractForExamine.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询合同详情 for 审核
    getAndValidate_QueryContractForResubmit() {
        let request = aisContractReqAndResp.queryContractForResubmit.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询合同详情根据ObjectCode
    getAndValidate_QueryContractByObjectCode() {
        let request = aisContractReqAndResp.queryContractByObjectCode.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询合同列表
    getAndValidate_QueryContractList() {
        let request = aisContractReqAndResp.queryContractList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询合同列表
    getAndValidate_QueryNBInsureListRepeat() {
        let request = aisContractReqAndResp.queryNBInsureListRepeat.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 审核合同
    getAndValidate_ExamineContract() {
        let request = aisContractReqAndResp.examineContract.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 注销合同
    getAndValidate_CancelContract() {
        let request = aisContractReqAndResp.cancelContract.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 审核编辑
    getAndValidate_EditExamineContract() {
        let request = aisContractReqAndResp.editExamineContract.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 合同审核记录
    getAndValidate_ExamineContractLogs() {
        let request = aisContractReqAndResp.examineContractLogs.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 编辑标的物信息
    getAndValidate_ObjectEdit() {
        let request = aisContractReqAndResp.objectEdit.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 保险信息修改
    getAndValidate_AisContractInsureEdit() {
        let request = aisContractReqAndResp.aisContractInsureEdit.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 保险信息修改
    getAndValidate_AisContractInsureDelete() {
        let request = aisContractReqAndResp.aisContractInsureDelete.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 合同过户
    getAndValidate_TransferOfContract() {
        let request = aisContractReqAndResp.transferOfContract.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 合同续费
    getAndValidate_RenewalOfContract() {
        let request = aisContractReqAndResp.renewalOfContract.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 备案统计
    getAndValidate_queryRecordStatistics() {
        let request = aisContractReqAndResp.queryRecordStatistics.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 修改用户授权
    getAndValidate_updateUserAuthorization() {
        let request = wxUserAuthorization.updateUserAuthorization.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询用户类型列表
    getAndValidate_queryUserTypeList() {
        let request = wxUserAuthorization.queryUserTypeList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 添加用户类型
    getAndValidate_addUserType() {
        let request = wxUserAuthorization.addUserType.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 修改用户类型
    getAndValidate_updateUserType() {
        let request = wxUserAuthorization.updateUserType.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 删除用户类型
    getAndValidate_deleteUserType() {
        let request = wxUserAuthorization.deleteUserType.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询设备分布
    getAndValidate_queryDeviceList() {
        let request = sysdeviceReqAndResp.queryDeviceList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询上下线记录表
    getAndValidate_queryDevOnlineRecord() {
        let request = sysdeviceReqAndResp.queryDevOnlineRecord.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    /**
     * 在哪小程序模块
     */
    getAndValidate_wxPaUsesrLogin() {
        let request = zainaXcxReqAndResp.wxPaUsesrLogin.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_QueryCustomerList() {
        let request = wxpaUserReqAndResp.queryCustomerList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_updateCustomer() {
        let request = wxpaUserReqAndResp.updateCustomer.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_resetPassword() {
        let request = wxpaUserReqAndResp.resetPassword.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_updateWxPauserPwd() {
        let request = zainaXcxReqAndResp.updateWxPauserPwd.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_findCustomer() {
        let request = wxpaUserReqAndResp.findCustomer.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 短信验证码
    getAndValidate_sendMsg() {
        let request = zainaXcxReqAndResp.sendMsg.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 小程序端验证码登录
    getAndValidate_wxPaUserLoginByPhone() {
        let request = zainaXcxReqAndResp.wxPaUserLoginByPhone.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 小程序端更换手机号
    getAndValidate_updatePhone() {
        let request = zainaXcxReqAndResp.updatePhone.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询防盗识别码
    getAndValidate_queryIdentity() {
        let request = zainaControlReqAndResp.queryIdentity.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询防盗布控
    getAndValidate_queryBurglaControl() {
        let request = zainaControlReqAndResp.queryBurglaControl.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询防盗布控详情
    getAndValidate_findBurglaControl() {
        let request = zainaControlReqAndResp.findBurglaControl.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询告警布控
    getAndValidate_queryDeviceDetailsList() {
        let request = zainaControlReqAndResp.queryDeviceDetailsList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 添加防盗布控
    getAndValidate_addBurglaControl() {
        let request = zainaControlReqAndResp.addBurglaControl.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_updateBurglaControl() {
        let request = zainaControlReqAndResp.updateBurglaControl.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_solving() {
        let request = zainaControlReqAndResp.solving.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_queryVehicleControl() {
        let request = zainaControlReqAndResp.queryVehicleControl.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_findVehicleControl() {
        let request = zainaControlReqAndResp.findVehicleControl.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_addVehicleControl() {
        let request = zainaControlReqAndResp.addVehicleControl.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_updateVehicleControl() {
        let request = zainaControlReqAndResp.updateVehicleControl.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_cancelAlarm() {
        let request = zainaControlReqAndResp.cancelAlarm.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_queryVehicleLock() {
        let request = zainaControlReqAndResp.queryVehicleLock.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_vehicleUnlock() {
        let request = zainaControlReqAndResp.vehicleUnlock.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    getAndValidate_queryAlarmList() {
        let request = zainaControlReqAndResp.queryAlarmList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    /* ****根据所属辖区统计备案数量*****/
    getAndValidate_caclulateCountByBranch() {
        let request = aisContractReqAndResp.caclulateCountByBranch.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    /**
     * 标签异常统计
     */
    getAndValidate_queryTagCodeAbnormalStatistics() {
        let request = aisContractReqAndResp.queryTagCodeAbnormalStatistics.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    /**
     * 查询设备上报
     */
    getAndValidate_queryEquipmentReport() {
        let request = aisContractReqAndResp.queryEquipmentReport.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询案件列表
    getAndValidate_QueryAisContractCaseList() {
        let request = aisContractCaseReqAndResp.queryAisContractCaseList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询案例详情
    getAndValidate_QueryAisContractCaseDetails() {
        let request = aisContractCaseReqAndResp.queryAisContractCaseDetails.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 指派外勤人员出警
    getAndValidate_DispatchPersonnel() {
        let request = aisContractCaseReqAndResp.dispatchPersonnel.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 出警记录
    getAndValidate_QueryPoliceRecordList() {
        let request = aisContractCaseReqAndResp.queryPoliceRecordList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 出警记录
    getAndValidate_QueryCaseDatas() {
        let request = aisContractCaseReqAndResp.queryCaseDatas.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 结束出警记录
    getAndValidate_EndThePolice() {
        let request = aisContractCaseReqAndResp.endThePolice.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 添加多媒体资料
    getAndValidate_AddAisContractCaseDatas() {
        let request = aisContractCaseReqAndResp.addAisContractCaseDatas.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 出警记录下拉列表
    getAndValidate_QueryPoliceRecordListForSelect() {
        let request = aisContractCaseReqAndResp.queryPoliceRecordListForSelect.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 出警记录下拉列表
    getAndValidate_QueryPoliceRecordPersonalListForSelect() {
        let request = aisContractCaseReqAndResp.queryPoliceRecordPersonalListForSelect.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 出警记录下拉列表
    getAndValidate_QueryPoliceRecordPersonalList() {
        let request = aisContractCaseReqAndResp.queryPoliceRecordPersonalList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },

    // 出警记录打卡记录
    getAndValidate_QueryPoliceRecordPersonalClockList() {
        let request = aisContractCaseReqAndResp.queryPoliceRecordPersonalClockList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },

    // 出勤打卡
    getAndValidate_PunchTheClock() {
        let request = aisContractCaseReqAndResp.punchTheClock.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },

    // 添加保险项目
    getAndValidate_AddAisInsure() {
        let request = aisInsureReqAndResp.addAisInsure.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询保险列表
    getAndValidate_QueryAisInsureListForSelect() {
        let request = aisInsureReqAndResp.queryAisInsureListForSelect.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询保险项目列表
    getAndValidate_QueryAisInsureList() {
        let request = aisInsureReqAndResp.queryAisInsureList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 保险项目详情
    getAndValidate_QueryAisInsureDetails() {
        let request = aisInsureReqAndResp.queryAisInsureDetails.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 修改保险项目
    getAndValidate_EditAisInsure() {
        let request = aisInsureReqAndResp.editAisInsure.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },

    getAndValidate_DeleteAisInsure() {
        let request = aisInsureReqAndResp.deleteAisInsure.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },

    getAndValidate_QueryNbProductList() {
        let request = aisNbProductReqAndResp.queryNbProductList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // nb设备保障利益优惠卷列表
    getAndValidate_QueryNbInsureCouponList() {
        let request = nbInsureCouponReqAndResp.queryNbInsureCouponList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 添加nb设备保障利益优惠卷
    getAndValidate_AddNbInsureCoupon() {
        let request = nbInsureCouponReqAndResp.addNbInsureCoupon.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 添加nb设备保障利益优惠卷
    getAndValidate_EditNbInsureCoupon() {
        let request = nbInsureCouponReqAndResp.editNbInsureCoupon.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 添加设备维修记录
    getAndValidate_AddDevRepairRecord() {
        let request = sysdeviceReqAndResp.addDevRepairRecord.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 获取回访数据（粗略）
    getAndValidate_ExportVisitDatas() {
        let request = visitRecordReqAndResp.exportVisitDatas.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 拨打记录列表
    getAndValidate_QueryCallList() {
        let request = visitRecordReqAndResp.queryCallList.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 客服下线（将任务回归到队列中）
    getAndValidate_ReturnWorkOrderTask() {
        let request = visitRecordReqAndResp.returnWorkOrderTask.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 更新合同手机号状态
    getAndValidate_UpdateContractPhoneState() {
        let request = aisContractReqAndResp.updateContractPhoneState.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 添加学生校徽
    getAndValidate_AddStudentSchoolBadge() {
        let request = aisContractReqAndResp.addStudentSchoolBadge.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 删除学生校徽
    getAndValidate_DeleteStudentSchoolBadge() {
        let request = aisContractReqAndResp.deleteStudentSchoolBadge.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 给备案用户分配合同模板
    getAndValidate_DistributionContractMouldForUserType() {
        let request = aisContractMouldReqAndResp.distributionContractMouldForUserType.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    },
    // 查询备案用户类型所拥有的合同模板权限
    getAndValidate_SelectContractMouldForUserType() {
        let request = aisContractMouldReqAndResp.selectContractMouldForUserType.request();
        this.ctx.validate(request);
        request = this.body;
        return request;
    }
};
